import request from '@/utils/request';
import { AxiosPromise } from 'axios';
import { cameraDefenseTaskCameraVO, cameraDefenseTaskCameraForm, cameraDefenseTaskCameraQuery } from '@/api/camera/camera-defense-task-camera/types';

/**
 * 查询布防任务-摄像机列表
 * @param query
 * @returns {*}
 */

export const listcameraDefenseTaskCamera = (query?: cameraDefenseTaskCameraQuery): AxiosPromise<cameraDefenseTaskCameraVO[]> => {
  return request({
    url: '/camera/camera-defense-task-camera/list',
    method: 'get',
    params: query
  });
};

/**
 * 查询布防任务-摄像机详细
 * @param cameraDefenseTaskCameraId
 */
export const getcameraDefenseTaskCamera = (cameraDefenseTaskCameraId: string | number): AxiosPromise<cameraDefenseTaskCameraVO> => {
  return request({
    url: '/camera/camera-defense-task-camera/' + cameraDefenseTaskCameraId,
    method: 'get'
  });
};

/**
 * 新增布防任务-摄像机
 * @param data
 */
export const addcameraDefenseTaskCamera = (data: cameraDefenseTaskCameraForm) => {
  return request({
    url: '/camera/camera-defense-task-camera',
    method: 'post',
    data: data
  });
};

/**
 * 修改布防任务-摄像机
 * @param data
 */
export const updatecameraDefenseTaskCamera = (data: cameraDefenseTaskCameraForm) => {
  return request({
    url: '/camera/camera-defense-task-camera',
    method: 'put',
    data: data
  });
};

/**
 * 删除布防任务-摄像机
 * @param cameraDefenseTaskCameraId
 */
export const delcameraDefenseTaskCamera = (cameraDefenseTaskCameraId: string | number | Array<string | number>) => {
  return request({
    url: '/camera/camera-defense-task-camera/' + cameraDefenseTaskCameraId,
    method: 'delete'
  });
};
